package com.xiaofen.license.util;

import org.apache.commons.lang3.SystemUtils;

/**
 * 获取操作系统类型
 *
 * @author zhang
 * @createDate: 2021/1/27 9:26
 * @version:1.0
 * @updateUser:[修改人]
 * @updateDate:[修改时间]
 * @updateRemark:[修改备注]
 */
public class GetOSUtils {

    public final static String WIN_OS = "WINDOWS";
    public final static String MAC_OS = "MAC";
    public final static String LINUX_OS = "LINUX";
    public final static String OTHER_OS = "OTHER";

    public static String getOS() {
        if (SystemUtils.IS_OS_WINDOWS){
            return WIN_OS;
        }
        if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_MAC_OSX){
            return MAC_OS;
        }
        if (SystemUtils.IS_OS_UNIX){
            return LINUX_OS;
        }
        return OTHER_OS;
    }
}
